namespace MuDBApp.Models
{
    using System;
    using Seditious.NETMF.MuDB;

    /// <summary>
    /// Represents a product for sale
    /// </summary>
    [Serializable]
    public class Product
    {
        /// <summary>
        /// The identifying number of the product.
        /// </summary>
        [PrimaryKey]
        public int Id;

        /// <summary>
        /// The name of the product.
        /// </summary>
        [Unique]
        public string Name;

        /// <summary>
        /// The cost of the product.
        /// </summary>
        public float Cost;

        /// <summary>
        /// Initializes a new instance of the Product class.
        /// </summary>
        /// <param name="id">The id of the product</param>
        /// <param name="name">The name of the product</param>
        /// <param name="cost">The cost of the product</param>
        public Product(int id, string name, float cost)
        {
            this.Id = id;
            this.Name = name;
            this.Cost = cost;
        }

        /// <summary>
        /// Returns a specially-formatted string of the instance data.
        /// </summary>
        /// <returns>A string of the instance data.</returns>
        public override string ToString()
        {
            return "Id:" + this.Id.ToString() + ", Name: " + this.Name + ", Cost: $" + this.Cost;
        }
    }
}
